#pragma once

#include <string>
#include <xercesc/dom/DOM.hpp>

namespace MCCommon
{

class Transcoder
{
public:
    /**
     * Constructor.
     * 
     */    
    Transcoder
    (   
        const std::string& toTranscode
    );    

    /**
     * Constructor.
     * 
     */
    Transcoder    
    (
        const XMLCh* const toTranscode
    );           

    /**
     * Destructor.
     * 
     */
    ~Transcoder();
   
    /**
     * Get UNICODE form.
     * 
     */
    const XMLCh* unicodeForm() const;

    /**
     * Get ASCII form.
     * 
     */
    const std::string asciiForm() const;

private :   
 
    // String in UNICODE form.
    XMLCh*   fUnicodeForm;

    // String in ASCII form.
    char* fAsciiForm;
};

#define W(str) Transcoder(str).unicodeForm()
#define A(str) Transcoder(str).asciiForm()

} // end of namespace MCXML_NAMESPACE.
